import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/staff',
    children: [
      {
        path: 'staff',
        name: 'Staff',
        component: () => import('@/views/Staff')
      },
      {
        path: 'goods',
        name: 'Goods',
        component: () => import('@/views/Goods')
      },
      {
        path: 'sale',
        name: 'Sale',
        component: () => import('@/views/Sale')
      },
      {
        path: 'activity',
        name: 'Activity',
        component: () => import('@/views/Activity')
      },
      {
        path: 'exhibit',
        name: 'Exhibit',
        component: () => import('@/views/Exhibit')
      },
      {
        path: 'cashiering',
        name: 'Cashiering',
        component: () => import('@/views/Cashiering')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
